package com.formula.datastructure.exam.tree;

import com.formula.datastructure.exam.queue.Queue;

public class BinLinkTree {

    private BinLinkNode root;

    public void addNode(BinLinkNode root) {

    }

    public void levelTraverse() {
        Queue<BinLinkNode> queue = new Queue<>();
        if (root != null) {
            queue.enqueue(root);
            while (!queue.isEmpty()) {
                BinLinkNode node = queue.dequeue();
                visit(node);
                if (node.left != null) {
                    queue.enqueue(node.left);
                }
                if (node.right != null) {
                    queue.enqueue(node.right);
                }
            }
        }
    }

    private void visit(BinLinkNode node) {
    }
}
